//
// LibGraphic_ncurse.hh for nibbler in /home/moreau_r//tek2/c++/nibbler/nibbler-2016-gomes_m/lib
// 
// Made by tristan moreau
// Login   <moreau_r@epitech.net>
// 
// Started on  Sun Mar 24 10:35:41 2013 tristan moreau
// Last update Sun Mar 24 18:05:48 2013 damien lefebvre
//

#ifndef		__LIBGRAPHIC_NCURSE_HH__
#define		__LIBGRAPHIC_NCURSE_HH__

#include        <curses.h>

#include	<string>
#include	<vector>
#include	<iostream>

#include	"IGraphicLibrary.hh"

class		LibGraphic_Ncurse : public IGraphicLibrary
{
public :
  class PictureOfElement
  {
  private :
    char				m_char;
    IGraphicLibrary::e_ListOfImage	m_type;

  public :
    PictureOfElement(char c, IGraphicLibrary::e_ListOfImage type);
    bool				isThatType(IGraphicLibrary::e_ListOfImage type) const;
    char				getChar(void) const;
    IGraphicLibrary::e_ListOfImage	getType(void) const;
  };

public :
  LibGraphic_Ncurse(unsigned int const size_x, unsigned int const size_y, std::vector<IGraphicLibrary::InfoPicture> const & listOfPictures);

  virtual void	refreshScreen(void);
  virtual void	draw(unsigned int const x, unsigned int const y, IGraphicLibrary::e_ListOfImage const e, IGraphicLibrary::e_Direction const dir = IGraphicLibrary::UP);
  virtual IGraphicLibrary::e_TypeOfEvent	checkEvent(void);
  virtual void	draw_footer(unsigned int const x, unsigned int const y, std::string const & str);

private :
  unsigned int			m_size_x;
  unsigned int			m_size_y;
  std::vector<PictureOfElement>		m_pictures;

  char				find_carac(IGraphicLibrary::e_ListOfImage e);
};

#endif
